jQuery(document).ready(function () {
                    jQuery('#KarenTableContainer').jtable({
                        title: 'Especimenes',
                        actions: {
                            listAction: 'especimen',
                            createAction: '/algo',
                            updateAction: '/algo',
                            deleteAction: '/algo'
                        },
                        fields: {
                            PersonId: {
                                key: true,
                                create: false,
                                edit: false,
                                list: false
                            },
                            Animal: {
                                title: 'Animal',
                                width: '5%',
                                type: 'combobox',
                                options: new Array('C30','C30','C30'),
                                defaultValue: 'C30'
                            },
                            Conservacion: {
                                title: 'Conservacion',
                                width: '5%',
                                type: 'combobox',
                                options: new Array('C20','C20','C20'),
                                defaultValue: 'C20'
                            },
                            
                            Sexo: {
                                title: 'Sexo',
                                width: '5%',
                                type: 'radiobutton',
                                options: { "M":"Masculino", "F":"Femenino", "A":"Asexual" },
                                defaultValue: 'M'
                            },
                            Madurez: {
                                title: 'Madurez',
                                width: '5%',
                                type: 'combobox',
                                options: new Array('C15','C15','C15'),
                                defaultValue: 'C15'
                            },
                            Habitat: {
                                title: 'Habitat',
                                width: '5%',
                                type: 'combobox',
                                options: new Array('C25','C25','C25'),
                                defaultValue: 'C25'
                            },
                            EstatusLocal: {
                                title: 'Estatus Local.',
                                width: '10%'
                            },
                            Estado: {
                                title: 'Estado',
                                width: '5%',
                                type: 'combobox',
                                options: new Array('C20','C20','C20'),
                                defaultValue: 'C20'
                            },
                            DescripcionTaxonomica: {
                                title: 'Descripcion Taxonomica.',
                                width: '13%',
                                type: 'textarea'
                            },
                            EstadoMuestra: {
                                title: 'Estado de la Muestra.',
                                width: '12%',
                                type: 'textarea'
                            },
                            UbicacionAlmacen: {
                                title: 'Ubicacion',
                                width: '5%'
                            },
                            Fisico: {
                                title: 'Fisico',
                                width: '04%',
                                sorting: false,
                                edit: false,
                                create: false,
                    display: function (data) {
                        //Create an image that will be used to open child table
                        var $img = $('<input type="button" value="Ver" />');
                        //Open child table when user clicks the image
                        $img.click(function () {
                            $('#KarenTableContainer').jtable('openChildTable',
                                    $img.closest('tr'),
                                    {
                                        title:'Fisico',
                                        actions: {
                                            listAction: 'fisico',
                                            createAction: '/algo',
                                            updateAction: '/algo'
                                        },
                                        fields: {
                                            PersonId: {
                                                key: true,
                                                create: false,
                                                edit: false,
                                                list: false
                                            },
                                            Textura: {
                                title: 'Textura',
                                width: '20%'
                            },
                            Coloracion: {
                                title: 'Coloracion',
                                width: '20%'
                            },
                            Longitud: {
                                title: 'Longitud',
                                width: '15%'
                            },
                            Diametro: {
                                title: 'Diametro',
                                width: '15%'
                            },
                            Altura: {
                                title: 'Altura',
                                width: '15%'
                            },
                            Peso: {
                                title: 'Peso',
                                width: '15%'
                            }
                                            
                          }
                                    }, function (data) { //opened handler
                                        data.childTable.jtable('load');
                                    });
                        });
                        //Return image to show on the person row
                        return $img;
                    }
                },
                            Tipo: {
                                title: 'Tipo',
                                width: '04%',
                                sorting: false,
                                edit: false,
                                create: false,
                    display: function (data) {
                        //Create an image that will be used to open child table
                        var $img = $('<input type="button" value="Ver" />');
                        //Open child table when user clicks the image
                        $img.click(function () {
                            $('#KarenTableContainer').jtable('openChildTable',
                                    $img.closest('tr'),
                                    {
                                        title:'Tipo',
                                        actions: {
                                            listAction: 'tipo',
                                            createAction: '/algo',
                                            updateAction: '/algo'
                                        },
                                        fields: {
                                            PersonId: {
                                                key: true,
                                                create: false,
                                                edit: false,
                                                list: false
                                            },
                                            Sustrato: {
                                                title: 'Sustrato',
                                                width: '25%',
                                                type: 'combobox',
                                                options: new Array('C30','C30','C30'),
                                                defaultValue: 'C30'
                                            },
                                            Altitud: {
                                                title: 'Altitud',
                                                width: '25%'
                                            },
                                            Hospedero: {
                                                title: 'Hospedero',
                                                width: '25%',
                                                type: 'combobox',
                                                options: new Array('C25','C25','C25'),
                                                defaultValue: 'C25'
                                            },
                                            EstadoHospedero: {
                                                title: 'Estado del hospedero',
                                                width: '25%'
                                            }
                                            
                          }
                                    }, function (data) { //opened handler
                                        data.childTable.jtable('load');
                                    });
                        });
                        //Return image to show on the person row
                        return $img;
                    }
                },
                Recoleccion: {
                                title: 'Recoleccion',
                                width: '04%',
                                sorting: false,
                                edit: false,
                                create: false,
                    display: function (data) {
                        //Create an image that will be used to open child table
                        var $img = $('<input type="button" value="Ver" />');
                        //Open child table when user clicks the image
                        $img.click(function () {
                            $('#KarenTableContainer').jtable('openChildTable',
                                    $img.closest('tr'),
                                    {
                                        title:'Recoleccion',
                                        actions: {
                                            listAction: 'recoleccion',
                                            createAction: '/algo',
                                            updateAction: '/algo'
                                        },
                                        fields: {
                                            PersonId: {
                                                key: true,
                                                create: false,
                                                edit: false,
                                                list: false
                                            },
                                            Fecha: {
                                                title: 'Fecha de recolecion',
                                                width: '14%',
                                                tipe: 'date',
                                                displayFormat: 'dd-mm-yyyy'
                                            },
                                            Equipo: {
                                                title: 'Equipo de recoleccion',
                                                width: '15%',
                                                type: 'textarea'
                                            },
                                            Confirma: {
                                                title: 'Confirma',
                                                width: '10%'
                                            },
                                            Determina: {
                                                title: 'Determina',
                                                width: '09%'
                                            },
                                            Temperatura: {
                                                title: 'Temperatura',
                                                width: '09%'
                                            },
                                            Altura: {
                                                title: 'Altura',
                                                width: '09%'
                                            },
                                            Latitud: {
                                                title: 'Latitud',
                                                width: '09%'
                                            },
                                            Longitud: {
                                                title: 'Longitud',
                                                width: '09%'
                                            },
                                            Observaciones: {
                                                title: 'Observaciones',
                                                width: '13%',
                                                type: 'textarea'
                                            }
                          }
                                    }, function (data) { //opened handler
                                        data.childTable.jtable('load');
                                    });
                        });
                        //Return image to show on the person row
                        return $img;
                    }
                }
                        }
                    });

                    jQuery('#KarenTableContainer').jtable('load');
                });